<?php

namespace app\command;

use app\services\order\OrderBonusServices;
use app\services\user\UserServices;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\facade\Log;

class MonthBonus extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('month_bonus')
            ->setDescription('每月静态收益');
    }

    protected function execute(Input $input, Output $output)
    {
        try {
            /** @var OrderBonusServices $bonusSrv */
            $bonusSrv = app()->make(OrderBonusServices::class);
            $bonusSrv->monthBonus();
        } catch (\Exception $e) {
            Log::info('每月静态收益错误：' . $e->getMessage());
        }
        $output->info('执行成功:每月静态收益');
    }

}